package chapter05.E4;

    public class E4 {
        public static void main(String[] args) {
            String s = "itcast";
            System.out.println("将it替换为cn.it的结果"+s.replace("it","cn.it"));
            String s1= "    i t c a s t   ";
            System.out.println("去除字符串前后空格的结果"+s1.trim());
            System.out.println("去除字符串中所有空格的结果"+s1.replace(" ",""));
        }
}
